﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EPlanet.Web.UI.WebControls;

namespace Web.Views.Public
{
    public struct ToolBarID
    {
        public const string Add = "tbAdd";
        public const string Delete = "tbDelete";
        public const string Export = "tbExport";
        public const string Help = "tbHelp";
        public const string Save = "tbSave";
        public const string Cancel = "tbCancel";
    }

    public class ToolBarHelper
    {
        public static void SetToolBarDisable(ToolBar toolBar, string sID, bool bDisable)
        {
            foreach (EPlanet.Web.UI.WebControls.MenuItem tbItem in toolBar.Items)
            {
                if (tbItem.ID == sID)
                {
                    tbItem.Disable = bDisable;
                    break;
                }
            }
        }
        public static void SetToolBarVisible(ToolBar toolBar, string sID, bool bVisible)
        {
            foreach (EPlanet.Web.UI.WebControls.MenuItem tbItem in toolBar.Items)
            {
                if (tbItem.ID == sID)
                {
                    tbItem.Visable = bVisible;
                    break;
                }
            }
        }	
    }
}
